package com.rdd.action

import org.apache.spark.{SparkConf, SparkContext}

object testFirst {

  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setAppName("testFirst").setMaster("local")
    val sc = new SparkContext(conf)

    val txt = sc.textFile("src\\main\\scala\\testTxt.txt")
    val str = txt.first()
    println(str)

    val value = txt.flatMap(x => (x.split(" "))).distinct()
    value.foreach(println)
    sc.stop()
  }

}
